<g:setProvider library="jquery"/>

<script type="text/javascript">
$('#listUserDialog').dialog('option', 'buttons', { 
		"Create": function() { $('#listUserHiddenSubmit').click(); }, 
		"Cancel": function() {
	        $(this).dialog("close");
	    }

	    function closePopUp2(){
	    	$('#listUserDialog').dialog("close");
	    }
});
</script>

<div class="body">
    <h1>User List</h1>
    <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
    </g:if>
    <div class="list">
        <table>
            <thead>
                <tr>
           	        <g:sortableColumn property="id" title="Id" />
           	        <g:sortableColumn property="name" title="Name" />
           	        <g:sortableColumn property="lastName" title="Last Name" />
           	        <g:sortableColumn property="alias" title="Alias" />
           	        <g:sortableColumn property="email" title="Email" />
           	        <g:sortableColumn property="dateCreated" title="Date Created" />
                </tr>
            </thead>
            <tbody>
            <g:each in="${userInstanceList}" status="i" var="userInstance">
                <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                    <td><g:remoteLink action="show" id="${userInstance.id}" update="listUserDialog">${fieldValue(bean:userInstance, field:'id')}</g:remoteLink></td>
                    <td>${fieldValue(bean:userInstance, field:'name')}</td>
                    <td>${fieldValue(bean:userInstance, field:'lastName')}</td>
                    <td>${fieldValue(bean:userInstance, field:'alias')}</td>
                    <td>${fieldValue(bean:userInstance, field:'email')}</td>
                    <td>${fieldValue(bean:userInstance, field:'dateCreated')}</td>
                </tr>
            </g:each>
            </tbody>
        </table>
    </div>
    <div class="paginateButtons">
        <g:paginate total="${userInstanceTotal}" />
    </div>
</div>
